package server.container;

import server.Servlet;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;

public class Context implements Container {

    //url及对应的servlet包装类
    private Map<String, Wrapper> map;

    private URLClassLoader classLoader;

    public Context(URL url) {
        classLoader = new URLClassLoader(new URL[]{url});
        map = new HashMap<>();
    }

    public URLClassLoader getClassLoader() {
        return classLoader;
    }

    public void setClassLoader(URLClassLoader classLoader) {
        this.classLoader = classLoader;
    }

    public Map<String, Wrapper> getMap() {
        return map;
    }

    public void setMap(Map<String, Wrapper> map) {
        this.map = map;
    }
}
